import React from 'react';
import {connect} from 'react-redux';
import { Modal, Button, } from 'antd';
import QrCode from "qrcode.react";
import { formatNumber, messages, deepFullCopy } from "share/common";


class UpdateRenewal extends React.Component{
  constructor(props){
    super(props);
    this.state = {}
  }
  
  render(){
    const {visible, title, onClose} = this.props;
    let qrLink = "https://h5.dingtalk.com/appcenter/detail.html?showmenu=false&dd_share=false&goodsCode=DD_GOODS-101001047305&corpId="
      + sessionStorage.getItem('corpId');
    return(
      <div>
        <Modal title={title}
               visible={visible}
               footer={<Button onClick={onClose} type="primary">{messages('common-1.key297')/*知道了*/}</Button>}
               onCancel={onClose}
        >
          <div>
            <div>{messages('common-1.key298')/*1、如果您使用的是安卓手机，可以扫描下方二维码在线购买*/}</div>
            <div>{messages('common-1.key299')/*2、如果您使用的是iphone（由于iphone钉钉客户端不支持在线付费），可以在钉钉电脑端应用市场搜索“超级报销”完成购买，或联系我们的客服人员400-829-7878*/}
            </div>
            <div style={{textAlign: "center"}}>
              <div style={{marginBottom: 10}}>{messages('common-1.key300')/*请使用「钉钉」扫码*/}</div>
              <div>
                <QrCode
                  value={qrLink}
                  renderAs={"svg"}
                  fgColor={"#000000"}
                  size={170}
                />
              </div>
            </div>
          </div>
        </Modal>
      </div>
    )
  }
  
}

UpdateRenewal.propTypes = {
  visible: React.PropTypes.bool,
  title: React.PropTypes.string,
  onClose: React.PropTypes.func,
};

UpdateRenewal.defaultProps = {
  visible: false,
  title: messages('common-1.key301')/*续费*/,
  onClose: ()=>{},
};

function mapStateToProps(state) {
  return{
    
  }
}

export default connect(mapStateToProps)(UpdateRenewal)
